/**
 * Copyright (C), 2015-2019, XXX有限公司
 * FileName: PackService
 * Author:   zhouheng
 * Date:     2019/5/2 22:49
 * Description: 包装服务
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package com.zhouh.patterns.com.zhouh.structure.facade;

import com.zhouh.patterns.com.zhouh.create.factory.factoryMethod.AppleBagFactory;
import com.zhouh.patterns.com.zhouh.create.factory.factoryMethod.FactoryMethodClient;
import com.zhouh.patterns.com.zhouh.entity.Bag;
import com.zhouh.patterns.com.zhouh.structure.decorator.BagDecorator;
import com.zhouh.patterns.com.zhouh.structure.decorator.CheckedBagDecorator;
import com.zhouh.patterns.com.zhouh.structure.decorator.ReinforceBagDecorator;
import com.zhouh.patterns.com.zhouh.structure.decorator.SpeedDecorator;

/**
 * 〈一句话功能简述〉<br> 
 * 〈包装服务〉
 *
 * @author zhouheng
 * @create 2019/5/2
 * @since 1.0.0
 */
public class PackService {
    /**
     * @description: 水果打包 防伪 加固 加急
     * @date: 2019/5/2 22:52
     * @author:zhouheng
     */
    public void doPack(){
        // 工厂方法创建打包袋对象
        AppleBagFactory factory = new AppleBagFactory();

        //得到包装
        Bag bag = factory.getBag();
        bag = new CheckedBagDecorator(bag);//防伪功能
        bag = new ReinforceBagDecorator(bag);//加固功能
        bag = new SpeedDecorator(bag);//加急功能

        bag.pack();
    }
}